<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>通知中心</title>
  <link rel="shortcut icon" href="/static/imag/favicon.ico" type="image/x-icon" />

  <link rel="stylesheet" href="/static/css/body.css">
  <style>
    .notification-center {
      /* justify-content: center; */
      margin-top: 20px;
      padding: 20px;
      background-color: var(--notification-bg-color);
      border-radius: 8px;
    }

    .notification-center h2 {
      font-size: 1.2em;
      /* 缩小字号 */
      display: inline-block;
      /* 使背景仅在文字上 */
      background-color: #28a745;
      /* 鲜绿色背景 */
      padding: 5px 10px;
      border-radius: 5px;
      margin-bottom: 20px;
    }

    .notification-list {
      height: 400px;
      overflow-y: auto;
      border: 1px solid #ccc;
      padding: 10px;
      background-color: var(--notification-list-bg-color);
      color: #fff;
      min-height: 55vh;
    }

    .notification-item {
      margin: 10px 0;
      padding: 10px;
      padding-top: 16px;
      background-color: var(--notification-item-bg-color);
      border-radius: 5px;
      /* color: var(--notification-item-system-text-color); */
      /* display: flex; */
      justify-content: space-between;
      /* white-space: pre-line; */
      /* 多行文本自动换行 */
      align-items: center;
      word-wrap: break-word;
      position: relative;
    }

    .notification-item .timestamp {
      font-size: 0.7em;
      /* 时间显示字体大小 */
      color: #ccc;
      /* 时间显示颜色 */
      margin-left: 10px;
      /* 时间显示位置 */
      position: absolute;
      left: 3px;
      top: 2px;
    }

    /* 按钮样式 */
    .send-message {
      display: flex;
      justify-content: center;
      margin-top: 50px;
      /* 扩大聊天框区域 */
    }

    .send-message #message-input {
      width: 70%;
      padding: 10px;
      border-radius: 5px;
      border: none;
      margin-right: 10px;
    }

    .send-message #send-button {
      padding: 10px 20px;
      background-color: var(--button-bg-color);
      border: none;
      border-radius: 5px;
      cursor: pointer;
      transition: background-color 0.3s ease;
    }

    .send-message #send-button:hover {
      background-color: #ff9a5a;
    }



    /* 弹窗 */
    /* 遮罩层 */
    .alert-mask {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(0, 0, 0, 0.3);
      z-index: 999;
    }

    /* 弹窗容器 */
    .custom-alert {
      display: none;
      position: fixed;
      /* 宽度和高度 */
      width: 310px;
      top: 40%;
      /* 位置调高 */
      left: 59%;
      transform: translate(-50%, -50%);
      background: #fff3f3;
      padding: 30px 40px;
      border-radius: 12px;
      box-shadow: 0 5px 30px rgba(255, 50, 50, 0.3);
      border: 2px solid #ff4444;
      z-index: 1000;
      animation: alertPop 0.3s ease;
    }

    /* 内容样式 */
    .alert-content {
      text-align: center;
      color: #d32f2f;
      font-family: Arial, sans-serif;
    }

    .alert-icon {
      font-size: 48px;
      color: #ff4444;
      margin-bottom: 15px;
    }

    .alert-message {
      font-size: 18px;
      margin: 15px 0;
      font-weight: bold;
      white-space: pre-line;
    }

    /* 按钮样式 */
    .alert-button {
      background: #ff4444;
      color: white;
      border: none;
      padding: 10px 25px;
      border-radius: 25px;
      cursor: pointer;
      font-size: 16px;
      transition: all 0.3s ease;
      margin-top: 15px;
    }

    .alert-button:hover {
      background: #ff0000;
      transform: scale(1.05);
    }

    /* 弹出动画 */
    @keyframes alertPop {
      from {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
      }

      to {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
      }
    }
  </style>
</head>

<body onload="get_msg()">

  <audio id="alarm" src="/static/imag/alarm.mp3" preload="auto" loop></audio>
  <div class="container">
    <!-- 侧边栏 -->
    <div class="sidebar">
      <h2>导航栏</h2>
      <a href="#" onclick="go_back()">返回首页</a>
      <a href="#" onclick="open_win()">窗户状态</a>
      <a href="#" onclick="open_msg()">通知中心</a>
      <a href="#" onclick="open_ai_chat()">ai聊天</a>
      <a href="#" onclick="open_audio()">语音提醒</a>
      <a href="#" onclick="open_lost_and_found()">失物招领中心</a>
      <a href="#" onclick="open_car_video()">小车视频</a>
    </div>

    <!-- 主内容区 -->
    <div class="main-content">
      <div class="header">
        <img src="./static/imag/logo.png" alt="Logo" class="logo" title="点击切换主题" id="logo_switchTheme">
        <h1>通知中心</h1>
        <div class="user-info">
          <img src="./static/imag/adm.jpg" alt="User Avatar">
          <div class="invite-code-popup">
            用户: <span id="uname">{{.username}}</span>
            <br>邀请码: {{.invitecode}}(禁止外传)
          </div>
          <div class="username">用户: {{.username}}</div>
          <button class="logout-button" onclick="logout()">退出登录</button>
        </div>
      </div>

      <div class="notification-center">
        <h2 id="net_status">网络已连接</h2>
        <div class="notification-list" id="messages">
        </div>
      </div>

      <!-- 输入框和发送按钮 -->
      <form class="send-message" id="message_form">
        <input type="text" placeholder="输入消息..." id="message-input">
        <input type="submit" value="发送" id="send-button">
      </form>
    </div>
  </div>

  <!-- 底部版权信息 -->
  <div class="footer">
    多模态智能校园管理平台-吉梦智体V1.0
  </div>


  <!-- 遮罩层 -->
  <div id="alertMask" class="alert-mask" style="display:none"></div>

  <!-- 弹窗结构 -->
  <div id="customAlert" class="custom-alert" >
    <div class="alert-content" sytle="position: relative;">
      <div class="alert-icon">⚠️</div>
      <p class="alert-message" id="alertMessage"></p>
      <button class="alert-button" onclick="closeAlert()">确认警报</button>
      <!-- <p style="position: absolute;bottom: 10px;right: 10px;color: #808080;font-size: 14px;" id="prosBtn">去处理>></p> -->
    </div>
  </div>





  <script src="/static/js/route.js"></script>
  <script src="/static/js/msg_center.js"></script>
</body>

</html>